<template>
  <div class="box">
    <div v-for="item in list" :key="item.id">
      <a class="game-item" target="_blank" :href="item.link" >
        <img :src="item.logo" alt="" class="game-logo">
        <div class="game-info">
          <div class="game-title">{{ item.title }}</div>
          <div class="game-desc">{{ item.desc }}</div>
        </div>
      </a>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";

const list = ref([
  {
    id:'走出大运河',
    link:'https://edition.cnn.com/interactive/2021/03/cnnix-steership/',
    logo:'https://edition.cnn.com/favicon.ico',
    title:'走出大运河',
    desc:'上帝视角操作轮船走出大运河！',
  },
  {
    id:'走出大运河1',
    link:'https://edition.cnn.com/interactive/2021/03/cnnix-steership/',
    logo:'https://edition.cnn.com/favicon.ico',
    title:'走出大运河1',
    desc:'上帝视角操作轮船走出大运河！1',
  }
])


</script>

<style lang="scss" scoped>
.game-item {
  width: 224px;
  height: 95px;
  padding: 10px;
  margin: 12px 0 0 12px;
  border: 1px solid #e4ecf3;
  box-shadow: 1px 2px 3px #f2f6f8;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  transition: all .3s;
  display: flex;
  align-items: center;
  cursor: pointer;
  &:hover{
    background: #f2f8fd;
    .game-title{
      color: #ee521c !important;
    }
  }

  .game-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
    margin-right: 10px;
  }

  .game-info {
    flex: 1;

    .game-title {
      font-size: 14px;
      font-weight: 700;
      color: #3273dc;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 0 0.1rem;
    }

    .game-desc {
      color: gray;
      font-size: 12px;
      height: 30px;
      word-break: break-all;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      margin-top: 5px;
    }
  }
}
@media (max-width: 480px) {
  .box{
    padding: 8px;
    justify-content: center;
    .game-item{
      width: 100%;
      margin: 5px 0;
    }
  }
}
</style>